<?php
	use yii\helpers\Html;
	use yii\helpers\Url;
	use yii\widgets\ActiveForm;
	use yii\widgets\LinkPager;
?>

<style type="text/css">
	.wrap {
		height:34px;
		padding-right: 22px;
		margin-left: 20px;
		background: #438EB9;
		color: white;
		border: none;
		border-radius: 5px;
	}
</style>

<div class="page-header">
	<h1>
		销售统计
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			数据查询
		</small>
	</h1>
</div><!-- /.page-header -->

<!-- PAGE CONTENT BEGINS -->
<?php $form = ActiveForm::begin([
	'enableClientValidation' => true,
	'method' => 'get',
	'options' => ['class' => 'form-search'],
])?>
	<div class="row" style="margin-bottom:15px;">
		<a href="<?= Url::toRoute('sale/today')?>"><input type="button" value="&nbsp;&nbsp;&nbsp;今日" class="wrap"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="<?= Url::toRoute('sale/week')?>"><input type="button" value="&nbsp;&nbsp;&nbsp;本周" class="wrap"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="<?= Url::toRoute('sale/pre')?>"><input type="button" value="&nbsp;&nbsp;&nbsp;上半月" class="wrap"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="<?= Url::toRoute('sale/last')?>"><input type="button" value="&nbsp;&nbsp;&nbsp;下半月" class="wrap"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
	</div>
<?php ActiveForm::end();?>

<div class="row">
	<div class="col-xs-12">
		<table id="simple-table" class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th class="center">id</th>
					<th class="hidden-480 cneter">登记时间</th>
					<th>客户名</th>
					<th>电话</th>
					<th>性别</th>
					<th>最新跟进时间</th>
					<th>意向度</th>
					<th>跟办人</th>
				</tr>
			</thead>

			<tbody>
				<?php $i="1"?>
				<?php foreach($model as $mod):?>
				<tr>
					<td class="center"><?php echo $i;?></td>
					<td><?php echo date("Y-m-d",$mod['visitTime']);?></td>
					<td><a href="#"><?php echo $mod['name'];?></a></td>
					<td><?php echo $mod['phone'];?></td>
					<td><?php echo $gender[$mod['gender']];?></td>
					<td class="hidden-480">
						<span class="label label-sm label-warning"><?php echo date("Y-m-d,h:i:s",$mod['updateTime']);?></span>
					</td>
					<td><?php echo isset($data['degree'][$mod['degree']]) ? $data['degree'][$mod['degree']] : "" ;?></td>									
					<td><?php echo $mod['sid'];?></td>
				</tr>
				<?php $i++;?>
				<?php endforeach;?>

			</tbody>
		</table>
		<?= LinkPager::widget(['pagination'=>$pages]);?>
	</div><!-- /.span -->
</div><!-- /.row -->

<div class="hr hr-18 dotted hr-double"></div>